@import './searchBar.scss';
@import './hints.scss';
@import './fileInfo.scss';

* {
  margin: 0;
  padding: 0;

  &:focus {
    outline: none;
  }
}

html {
  overflow: auto;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  user-select: none;
  font-family: 'Roboto', sans-serif;
  -webkit-tap-highlight-color: transparent;
  background-color: #9999ff;
  background-color: var(--primary-color);
  color: #252525;
  color: var(--text-color);

  &.no-animation * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  &:not(.loading).title-loading {
    &.title-loading-hide {
      &::after {
        background-image: none;
        transform: translateX(-50%) translateY(-100%) scale3d(0.5, 0.5, 1);
        opacity: 0;
        animation: hide-loader 100ms ease-in 1;
        @keyframes hide-loader {
          from {
            transform: translateX(-50%) translateY(0) scale3d(1, 1, 1);
            opacity: 1;
          }
          to {
            transform: translateX(-50%) translateY(-100%) scale3d(0.5, 0.5, 1);
            opacity: 0;
          }
        }
      }
    }

    &::after {
      content: '';
      background-color: #3333ff;
      background-color: var(--primary-color);
      border-radius: 50%;
      position: fixed;
      height: 40px;
      width: 40px;
      top: 6px;
      left: 50%;
      transform: translateX(-50%);
      background-image: url(./res/tail-spin.svg);
      background-image: var(--tail-spin);
      background-repeat: no-repeat;
      background-position: center;
      background-size: 30px;
      box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.2);
      box-shadow: 0 0 4px 0 var(--box-shadow-color);
      border: solid 1px transparent;
      border: solid 1px var(--popup-border-color);
      animation: appear 100ms ease-out 1;
      box-sizing: border-box;
      z-index: 999;

      @keyframes appear {
        from {
          transform: translateX(-50%) translateY(-100%) scale3d(0.5, 0.5, 1);
          opacity: 0.5;
        }
        to {
          transform: translateX(-50%) translateY(0) scale3d(1, 1, 1);
          opacity: 1;
        }
      }
    }
  }

  .main {
    position: relative;
  }
}

a {
  color: #615efd;
  color: var(--a-color);
}

.open-file-list {
  position: absolute;
  top: 44px;
  top: calc(var(--header-height));
  height: 31px;
  width: 100%;
  background-color: #9999ff;
  background-color: var(--primary-color);
  overflow-x: auto !important;
  overflow-y: hidden !important;
  display: flex;
  flex-direction: row !important;
  color: white;
  color: var(--text-main-color);
  z-index: 5;

  li.tile {
    height: calc(100% - 1px);
    overflow: hidden;
    font-size: 0.8em;
    align-items: center;
    margin: 0;
    margin-top: auto;
    padding: 0;
    color: inherit;
    min-width: 110px;
    max-width: 110px;

    .text {
      display: inline-block;
      white-space: nowrap;
      max-width: 180px;
      overflow: hidden;
      text-overflow: ellipsis;
      margin: 0;
      padding: 0;
      color: inherit;
    }

    &.select {
      position: absolute;
      left: 0;
      top: 0;
    }

    &.notice {
      &::before {
        content: '•';
        color: #ffda0c;
        font-size: 1.5em;
        margin-left: 2.5px;
        text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
      }
    }

    &.active {
      border-top: solid 2px gold;
      background-color: rgba(0, 0, 0, 0.2);
    }

    .file,
    .icon {
      height: 24px;
      width: 24px;
      font-size: 1em;
      background-size: 22px;
      background-position: center;
      color: inherit;
    }
  }
}

a.icon {
  pointer-events: all !important;
  color: white;

  &:focus,
  &:active {
    border: none;
    outline: none;
  }
}

#ad {
  border-radius: 4px;
  background-color: white;
  color: #232323;
  display: flex;
  flex-direction: column;
  width: calc(100% - 10px);
  max-width: 600px;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 4px 0 var(--box-shadow-color);
  padding-bottom: 10px;

  .heading {
    margin-top: -5px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.4rem;

    .text {
      font-weight: 400;
      margin: 0 10px;
    }

    .icon {
      font-size: 1.2rem;
      height: 30px;
      width: 30px;
      margin: 5px;
    }
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  .ad-body {
    display: flex;

    .image {
      min-height: fit-content;
      min-width: fit-content;
      margin: auto;

      img {
        margin: 0 5px;
        max-width: 100px;
        border-radius: 4px;
      }
    }

    .content {
      margin-right: 5px;
      display: flex;
      flex-direction: column;

      .title {
        font-weight: 500;
      }

      .description {
        text-transform: none;
        white-space: pre-wrap;
        font-size: 0.92rem;
      }
    }
  }
}

.no-scroll {
  &::-webkit-scrollbar {
    width: 0px;
    height: 0px;
  }
}

.list,
.prompt,
.scroll {
  &::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.333);
    background: var(--scrollbar-color);
    border-radius: 2px;
  }
}

.octicon,
.icon {
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  &.hidden {
    display: none !important;
  }

  &.app-logo {
    background-image: url(./res/logo/logo.png);
    background-position: center;
    background-size: 24px;
    background-repeat: no-repeat;
  }

  &.color {
    display: flex;

    &::before {
      content: '';
      height: 16px;
      width: 16px;
      border: solid 1px #a90000;
      border: solid 1px var(--accent-color);
      background-color: currentColor;
      color: inherit !important;
    }

    &.dark {
      color: #252525;
    }

    &.light {
      color: #ffffff;
    }
  }

  &.notice {
    position: relative;

    &::after {
      content: '•';
      position: absolute;
      top: 5px;
      right: 5px;
      color: #ffda0c;
      font-size: 1.4em;
      height: fit-content;
      line-height: 4px;
      text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.5);
    }
  }

  &.angularjs::before {
    content: '\e92f';
    color: #dd0031;
  }

  &.html::before {
    content: '\e939';
    color: #e34f26;
  }

  &:focus {
    border: solid 1px rgba(255, 238, 0, 0.5);
    box-sizing: border-box;
  }

  &.disabled {
    opacity: 0.6;
    pointer-events: none;
  }

  &.dull {
    opacity: 0.6;
  }

  &:not(.floating):active {
    transition: all 100ms ease;
    background-color: rgba(0, 0, 0, 0.2) !important;
  }

  &.active {
    background-color: rgba(0, 0, 0, 0.2) !important;
    background-color: var(--active-icon-color) !important;
  }

  &.foxdebug {
    background-image: url(./res/logo/favicon.ico);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
  }

  &.no-icon {
    max-width: 10px;
  }
}

.mask {
  position: fixed;
  left: 0;
  top: 0;
  display: block;
  height: 100vh;
  width: 100vw;
  background-color: black;
  opacity: 0;
}

footer {
  &.button-container,
  .button-container {
    background-color: #9999ff;
    background-color: var(--primary-color);
    color: white;
    color: var(--text-main-color);
  }
}

.button-container {
  display: flex;
  min-height: 40px;
  min-height: var(--footer-height);
  background-color: inherit;
  color: inherit;
  user-select: none;
  width: 100%;

  &.primary {
    button {
      color: white !important;
      color: var(--button-text-color) !important;
      background-color: #39f !important;
      background-color: var(--button-background-color) !important;
      box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
      box-shadow: 0 0 4px var(--box-shadow-color);
      border-radius: 4px;

      &:active {
        background-color: #2c8ef0 !important;
        background-color: var(--button-active-color) !important;
        box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
        box-shadow: inset 0 0 2px var(--box-shadow-color);
      }
    }
  }

  &.disabled {
    pointer-events: none;

    .icon,
    input,
    button {
      opacity: 0.6;
    }
  }

  > button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    text-transform: uppercase;
    background-color: inherit;
    color: inherit;

    * {
      pointer-events: none;
    }

    &.disabled {
      pointer-events: none;
      opacity: 0.6;
    }

    &:active {
      transition: all 100ms ease;
      box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
      box-shadow: inset 0 0 4px var(--box-shadow-color);
    }

    &:disabled {
      opacity: 0.6;
    }
  }

  textarea,
  input {
    flex: 2;
    height: unset;
    color: inherit;
    border-bottom: 1px solid currentColor;
    margin: 5px;
    background-color: inherit;

    &::placeholder {
      color: rgba(255, 255, 255, 0.6);
    }
  }

  .icon {
    color: inherit;
    font-size: 1.3em;
  }

  .search,
  .save {
    font-size: 1em;
  }
}

input {
  height: 40px;
  outline: none;
  border: none;
  background-color: inherit;
  border-bottom: solid 1px #252525;
  border-bottom: solid 1px var(--text-color);
  padding: 0;
  box-sizing: border-box;
  color: #252525;
  color: var(--text-color);
  text-indent: 10px;

  ::placeholder {
    color: #252525;
    color: var(--text-color);
    opacity: 0.5;
  }

  &:focus {
    border-bottom-color: #a90000 !important;
    border-bottom-color: var(--accent-color) !important;
  }
}

input,
textarea {
  &::placeholder {
    color: #252525;
    color: var(--text-color);
    opacity: 0.8;
    text-transform: lowercase;
  }
}

.search-status {
  flex: 1;
  display: flex;
  color: white;
  color: var(--text-main-color);
  align-items: center;
  justify-content: center;

  span:not(:nth-child(2)) {
    margin: 0 5px;
    color: white;
    color: var(--text-main-color);
  }
}

.cursor-control {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background-color: white;
  background-color: var(--text-main-color);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 2px var(--box-shadow-color);
  z-index: 4;

  &.large {
    height: 30px;
    width: 30px;
  }

  &.none {
    display: none;
  }

  &.end {
    border-radius: 0% 50% 50% 50%;
  }

  &.start {
    border-radius: 50% 0 50% 50%;
  }
}

.clipboard-contextmneu {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #ffffff;
  background-color: var(--secondary-color);
  display: flex;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 8px var(--box-shadow-color);
  color: #252525;
  color: var(--text-color);
  z-index: 4;

  > span {
    display: inline-block;
    height: 30px;
    line-height: 30px;
    margin: 5px 0;
    padding: 0 5px;
    font-size: 0.9em;
    min-width: 67px;
    text-align: center;
    color: inherit;
    user-select: none;
    white-space: nowrap;

    &:not(:last-child) {
      border-right: solid 0.5px currentColor;
    }

    &.disabled {
      opacity: 0.6;
      pointer-events: none;
    }
  }
}

.file {
  display: flex;
  align-items: center;
  justify-content: center;
  background-repeat: no-repeat;
  background-position: 6px center;
  background-size: 18px;
  width: 30px;
  height: 30px;
}

.hr {
  display: flex;
  align-items: center;
  margin: auto auto 15px auto;

  &::after,
  &::before {
    content: '';
    height: 1px;
    width: 60px;
    background-color: #252525;
    background-color: var(--text-color);
    margin: auto 15px;
    opacity: 0.5;
  }
}

.d-none {
  display: none !important;
}

.input-checkbox {
  display: inline-flex;
  align-items: center;

  input {
    display: none;
  }

  .box {
    display: flex;
    height: 1.2rem;
    width: 1.2rem;
    border-radius: 4px;
    border: solid 1px #252525;
    border: solid 1px var(--text-color);
    margin: 0 5px;

    &::after {
      content: '';
      display: block;
      height: 80%;
      width: 80%;
      background-color: #3399ff;
      background-color: var(--button-background-color);
      margin: auto;
      border-radius: 2px;
    }
  }

  input:checked {
    & + .box::after {
      opacity: 1;
    }
  }

  input:not(:checked) {
    & + .box::after {
      opacity: 0;
    }
  }
}

.floating.icon {
  position: fixed;
  height: 40px;
  width: 40px;
  font-size: 1.8rem;
  border: 1px solid;
  background-color: #9999ff;
  background-color: var(--primary-color);
  top: 10px;
  right: 10px;
  opacity: 0.2;
  box-sizing: border-box;
  color: white;
  color: var(--text-main-color);
  transition: all 300ms ease;

  &.hide {
    opacity: 0 !important;
  }
}

#social-links {
  position: relative;
  height: 60px;
  font-size: 1.2em;
  width: 100%;
  text-align: center;

  &::after {
    display: block;
    width: 100%;
    content: attr(title);
    text-align: center;
    font-size: 0.5em;
    text-transform: none;
  }

  a {
    display: inline-flex;
    min-height: 40px;
    min-width: 40px;
    text-shadow: 0 0 5px white;

    &.github {
      color: black;
    }
  }
}

#header-toggler {
  display: none;
  top: 10px;
  right: 10px;
}

#quicktool-toggler {
  top: auto;
  bottom: 10px;
  right: 10px;
}

#toast {
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  margin: 0 auto;
  background-color: rgba(9, 14, 29, 0.9);
  box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 0.8rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  max-height: 50vh;
  max-width: 80vw;
  width: fit-content;
  overflow: auto;
  animation: slow-appear 500ms linear 1;
  z-index: 9999;
  border-radius: 4px;
  pointer-events: none;

  &.hide {
    transition: all 1s linear;
    opacity: 0;
  }
}

@keyframes move-around {
  0% {
    transform: scaleX(1) translate3d(-100px, 0, 0);
    background-color: rgb(211, 106, 106);
  }

  25% {
    background-color: rgb(157, 211, 106);
  }

  50% {
    transform: scaleX(1) translate3d(100px, 0, 0);
    background-color: rgb(211, 106, 197);
  }

  75% {
    background-color: rgb(130, 106, 211);
  }

  100% {
    transform: scaleX(1) translate3d(-100px, 0, 0);
    background-color: rgb(211, 106, 106);
  }
}

@keyframes slow-appear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
